package Entity;

/**
 * @author chenjian
 * @version 1.0
 * @date 2025/3/20 15:33
 * @description  程序员类（基类）-----也就是父类
 */
public  abstract class Programmer {

    public String name;//姓名
    public int id;//工号
    public double salary;//工资/月薪

    public Programmer() {
    }

    public Programmer(String name, int id, double salary) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;

    }

    //行为
    public abstract void work();
        //System.out.println(name+"\t工号"+id+"\t工资"+salary+"\t年薪"+finasalary());

    public double finasalary(){
        return salary*12;
    }
}
